<?php 
namespace app\api\controller;

use think\Controller;
use speech\AipSpeech;

class Speech extends Controller
{
    public function radio_distinguish($path,$format,$sampleRate){
        // require_once "../extend/speech/AipSpeech.php";
        $client = new AipSpeech(APP_ID, API_KEY, SECRET_KEY);

        // 识别本地文件
        $data = $client->asr(file_get_contents($path), $format, $sampleRate, array(
            'lan' => 'zh',
        ));
        return $data;
    }
}